#include <bits/stdc++.h>

#define eb emplace_back
#define ep emplace
#define fi first
#define se second
#define in read<int>()
#define lin read<ll>()
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using db = double;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

template < typename T > T read() {
	T x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-', ch = getchar();
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

template < typename T > void chkmax(T &x, const T &y) { x = x > y ? x : y; }
template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

const int N = 1010;

int n;
int x[N], y[N], p[N];

db sq(db x) { return x * x; }
db d(int a, int b) { return sqrt(sq(x[a] - x[b]) + sq(y[a] - y[b])); }

db f[N][N], g[N][N];
bool usd[N][N];
int pf[N][N], pg[N][N];

void upd(db &x, int &cho, db ret, int v) {
	if(ret < x) x = ret, cho = v;
}

vec build(int x, int y, int fl = 0) {
	if(x == y) return f[p[x]][p[x]] = 0, vec{p[x]};
	vec lpot, rpot;
	if(fl == 1) {
		sort(p + x, p + y + 1, [&](int a, int b) { return ::y[a] < ::y[b]; });
		int mid = x + y - 1 >> 1; lpot = build(x, mid, fl ^ 1), rpot = build(mid + 1, y, fl ^ 1);
	} else {
		sort(p + x, p + y + 1, [&](int a, int b) { return ::x[a] < ::x[b]; });
		int mid = x + y - 1 >> 1; lpot = build(x, mid, fl ^ 1), rpot = build(mid + 1, y, fl ^ 1);
	}
	for(auto x : lpot) for(auto y : lpot) if(!usd[x][y]) {
				for(auto z : rpot) upd(g[x][z], pg[x][z], f[x][y] + d(y, z), y);
			}
	for(auto x : rpot) for(auto y : rpot) if(!usd[x][y]) {
				for(auto z : lpot) upd(g[x][z], pg[x][z], f[x][y] + d(y, z), y);
			}
	for(auto x : lpot) for(auto y : rpot) for(auto z : rpot) if(!usd[y][z]) {
					upd(f[x][y], pf[x][y], g[x][z] + f[z][y], z);
				}
	for(auto x : rpot) for(auto y : lpot) for(auto z : lpot) if(!usd[y][z]) {
					upd(f[x][y], pf[x][y], g[x][z] + f[z][y], z);
				}
	/*
	for(auto x : lpot)
		for(auto y : lpot) if(!usd[x][y])
							   for(auto z : rpot)
								   for(auto t : rpot) if(!usd[z][t])
														  chkmin(f[x][t], f[x][y] + f[z][t] + d(y, z));
	*/
	for(auto x : lpot) for(auto y : lpot) usd[x][y] = true;
	for(auto x : rpot) for(auto y : rpot) usd[x][y] = true;
	for(auto v : rpot) lpot.eb(v);
	return lpot;
}

void calc(int x, int y) {
	if(x == y) return printf("%d ", x), void();
	int b = pf[x][y], a = pg[x][b];
	calc(x, a), calc(b, y);
}

void solve() {
	n = in; rep(i, 1, n) x[i] = in, y[i] = in, p[i] = i;
	rep(i, 1, n) rep(j, 1, n) f[i][j] = g[i][j] = 1e18; build(1, n);
	db ans = 1e18; pii ret;
	rep(i, 1, n) rep(j, 1, n) if(!usd[i][j]) if(f[i][j] < ans) ans = f[i][j], ret = { i, j };
	printf("%.10lf\n", ans);
	calc(ret.fi, ret.se);
}

int main() {
#ifdef YJR_2333_TEST
	freopen("1.in", "r", stdin);
#endif
	for(int T = 1; T; T--) solve();
	return 0;
}
